﻿using Microsoft.Practices.CompositeUI;
using Module.Extension.FileManagerModule.Services;
using BusinessEntity.Common;
using BusinessEntity.FileManagement;

namespace Module.Extension.FileManagerModule.Controller
{
    public class FileManagerController : Microsoft.Practices.CompositeUI.Controller
	{
		// We depend on the customer queue service to tell us which customer is next
        private FileManagerService service;

		[ServiceDependency]
        public FileManagerService FileManagerService
		{
			set { service = value; }
		}

        public SortableCollection<MyFile> Load(MyFile oSearchMyFile)
        {
            return service.Load(oSearchMyFile);
        }

        public SortableCollection<MyFileType> LoadFileType()
        {
            return service.LoadFileType();
           
        }

        public SortableCollection<DocumentType> LoadDocumentType()
        {
            return service.LoadDocumentType();
        }

        public SortableCollection<CoreUser> LoadCoreUsers()
        {
            return service.LoadCoreUsers();

        }

        public void Save(SortableCollection<MyFile> oFiles)
        {
            service.Save(oFiles);
            
        }

        public void Upload(MyFile oMyFile)
        {
            service.UploadFile(oMyFile);
        }

        public void DeleteFile(int fileId)
        {
            service.DeleteFile(fileId);
        }
	}
}